$(document).ready(
  function () {
    var a = $("#store-pwd").click(function () {
        $(this).toggleClass("select")
      }),
      b = $('input[name="username"]'),
      c = $('input[name="password"]');
    $("input").focus(function () {
      $(this).removeClass("error"), $(this).next(".invalid-info").hide()
    });
    var d = function (a, b) {
        a.addClass("error"), a.next(".invalid-info").text(b).show()
      },

      e = $("#reactivate").click(
        function () {
          var a = b.val(), e = c.val();
          return FX.Utils.isEmpty(a) ? void d(b, "账号不能为空") : FX.Utils.isEmpty(e) ? void d(c, "密码不能为空")
            : void FX.Utils.ajax({
            url: "/reactivate",
            data: {
              username: a,
              password: e
            }
          }, function (a) {
            FX.Utils.redirectTo("/confirm?email=" + a.email)
          }, function () {
            FX.Msg.toast({
              type: "warning",
              msg: "您输入的账号有误"
            })
          })
        }),

      f = function () {
        var f = b.val(), g = c.val();
        if (FX.Utils.isEmpty(f))
          return void d(b, "账号不能为空");
        if (FX.Utils.isEmpty(g))
          return void d(c, "密码不能为空");
        var h = {
          dbConn: f,
          localPath: g,
          needRem: a.hasClass("select")
        }, i = FX.Utils.getUrlParameter("wx_openid");

        i && (h.wx_openid = i),
          $.ajax({
            type: "POST",
            url: "../ser/setDb",
            data: "str=" + JSON.stringify(h),
            dataType: 'text',
            success: function (data) {
              var dd = JSON.parse(data);
              if (dd.code == 0)
                location.href = "../main/login.jsp";
              else if (dd.code == -1)
                d(b, "账号不能为空");
              else if (dd.code == -2)
                d(c, "密码不能为空");
              else
                cm.myAlert(dd.msg);
            }
          })
      };
    $("#signinBtn").click(function () {
      f()
    }), $(document).keydown(function (a) {
      13 === a.keyCode && f()
    }), $("#other-login-type").click(function () {
      $(".other-login-list").slideToggle("fast")
    })
  });